package guoanmaker.operator.business.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import guoanmaker.operator.business.model.OperatorMessage;

public interface OperatorMessageRepository extends JpaRepository<OperatorMessage, String>, JpaSpecificationExecutor<OperatorMessage>{
	@Query("select u from OperatorMessage u  where u.sendStatus=1 and u.ifEffect=1 order by u.createTime desc")
	 public List<OperatorMessage> findByOperatorMessages();
	@Query("select u from OperatorMessage u  where u.sendStatus=2 and u.ifEffect=1 order by u.createTime desc")
	 public Page<OperatorMessage> findByOperatorMessagesBypage(Pageable pageable);
	
}
